#ifndef OPERATOR_H
#define OPERATOR_H


#include "Collect.h"
#include "MyDialog.h"

#include <QChart>
#include <QDialog>
#include <QLineSeries>
#include <QMap>
#include <QMutex>
#include <QValueAxis>
namespace Ui {
class Operator;
}
using namespace QtCharts;
class Operator : public MyDialog
{
    Q_OBJECT

public:
    explicit Operator(QWidget *parent = nullptr);
    Collect *getCollect();
    ~Operator();
signals:
    void showSiri_signal();
    void isStartCollect(int timeInterval,bool r);
    void siriWork_signal(MyDialogName dialogName,functionFlag flag);
    //void showPatient_signal(QString str);
public slots:
    void siriWork(MyDialogName name,functionFlag flag);
private slots:

    void on_number1_clicked();
    void on_number2_clicked();
    void on_number3_clicked();
    void on_number4_clicked();
    void on_number5_clicked();
    void on_number6_clicked();
    void on_number7_clicked();
    void on_number8_clicked();
    void on_number9_clicked();
    void on_number0_clicked();
    void on_cancel_clicked();
    void on_yes_clicked();

    void on_mode_clicked();

    void on_collectPush_clicked();

    void paintingChart();

    void on_clearData_clicked();

protected:
    void setFuzzyEnabled(bool r);
    void paintChart();
    void updateAxisRange();
private:
    Ui::Operator *ui;
    QGraphicsBlurEffect *blurEffect=nullptr;

    QtCharts::QChart *chart=nullptr;
    QtCharts::QSplineSeries *series = nullptr;
    QValueAxis *axisY=nullptr;
    QValueAxis *axisX=nullptr;


    int xNumbersMax=50;//x轴最多一次性可看五十个点
    QMutex* collectLock=nullptr;
    Collect *collect=nullptr;

};

#endif // OPERATOR_H
